
-- --------------------------------------------------
-- Entity Designer DDL Script for SQL Server 2005, 2008, and Azure
-- --------------------------------------------------
-- Date Created: 10/08/2013 01:39:08
-- Generated from EDMX file: D:\PizzaProgram\Pizza\Entity\PizzaBase.edmx
-- --------------------------------------------------

SET QUOTED_IDENTIFIER OFF;
GO
USE [PizzaBase];
GO
IF SCHEMA_ID(N'dbo') IS NULL EXECUTE(N'CREATE SCHEMA [dbo]');
GO

-- --------------------------------------------------
-- Dropping existing FOREIGN KEY constraints
-- --------------------------------------------------


-- --------------------------------------------------
-- Dropping existing tables
-- --------------------------------------------------

IF OBJECT_ID(N'[dbo].[City]', 'U') IS NOT NULL
    DROP TABLE [dbo].[City];
GO
IF OBJECT_ID(N'[dbo].[Job_Type]', 'U') IS NOT NULL
    DROP TABLE [dbo].[Job_Type];
GO

-- --------------------------------------------------
-- Creating all tables
-- --------------------------------------------------

-- Creating table 'Job_Type'
CREATE TABLE [dbo].[Job_Type] (
    [ID] int  NOT NULL,
    [Name] nvarchar(20)  NOT NULL,
    [ClassLevel] tinyint  NOT NULL,
    [OrderBy] int  NOT NULL,
    [JobTypeID] int  NOT NULL,
    [Tag] nvarchar(20)  NOT NULL
);
GO

-- Creating table 'City'
CREATE TABLE [dbo].[City] (
    [ID] int IDENTITY(1,1) NOT NULL,
    [Name] nvarchar(20)  NULL,
    [Tag] nvarchar(20)  NOT NULL,
    [CityID] int  NOT NULL,
    [ClassLevel] tinyint  NOT NULL,
    [OrderBy] int  NOT NULL,
    [Letters] nvarchar(2)  NOT NULL
);
GO

-- --------------------------------------------------
-- Creating all PRIMARY KEY constraints
-- --------------------------------------------------

-- Creating primary key on [ID] in table 'Job_Type'
ALTER TABLE [dbo].[Job_Type]
ADD CONSTRAINT [PK_Job_Type]
    PRIMARY KEY CLUSTERED ([ID] ASC);
GO

-- Creating primary key on [ID] in table 'City'
ALTER TABLE [dbo].[City]
ADD CONSTRAINT [PK_City]
    PRIMARY KEY CLUSTERED ([ID] ASC);
GO

-- --------------------------------------------------
-- Creating all FOREIGN KEY constraints
-- --------------------------------------------------

-- --------------------------------------------------
-- Script has ended
-- --------------------------------------------------